/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package abricots.entity.drawer;

import abricots.entity.ServerEntity;
import abricots.entity.state.EntityState;
import abricots.entity.state.ServerEntityState;
import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;

/**
 *
 * @author charly
 */
public class ServerEntityDrawer implements EntityDrawer {
   private ServerEntity entity;

   public ServerEntityDrawer(ServerEntity entity) {
      this.entity = entity;
   }

   @Override
   public void draw(EntityState state, Graphics g) {
      Color color = Color.green;
      ServerEntityState serverEntityState = (ServerEntityState) state;
      if (serverEntityState.isCollision()) {
         color = Color.cyan;
      }
      g.setColor(color);
      g.fillRect(serverEntityState.getPosX() - 10, serverEntityState.getPosY() - 20, 20, 40);
   }
}
